

document.addEventListener("DOMContentLoaded", async function () {
	// 用prosime写个等待函数
	function wait(ms) {
		return new Promise(resolve => setTimeout(resolve, ms));
	}

	await wait(2000)
	console.log(1111);

	// 禁止复制
	document.addEventListener("copy", function (e) {
		// console.log(1);
		e.stopPropagation();
	}, true);

	// 禁止选中
	Array.from(document.querySelectorAll("code")).map(code => {
		code.style = "user-select:text;";
	})

	// 弹窗
	setInterval(() => {
		Array.from(document.querySelectorAll(".passport-login-container")).map(code => {
			code.style = "display:none;";
		})
		Array.from(document.querySelectorAll(".passport-login-tip-container")).map(code => {
			code.style = "display:none;";
		})
	}, 2000);



	// 复制按钮
	Array.from(document.querySelectorAll("code")).map(code => {
		var copyBtn = document.createElement("div");
		copyBtn.className = "hljs-button signin active";
		copyBtn.setAttribute('data-title', "不登录复制")
		copyBtn.style = 'width:100px!important;right:80px;'
		copyBtn.addEventListener('click', function (e) {
			navigator.clipboard.writeText(code.innerText)
		})
		code.appendChild(copyBtn)
	})





	// 阅读全文
	const text = document.querySelectorAll('span.follow-text')[0];
	console.log(text);
	var expandBtn = document.createElement("span");
	expandBtn.className = "follow-text";
	expandBtn.style = 'margin-right:20px'
	expandBtn.innerText = "不关注博主也可阅读全文啊"
	expandBtn.onclick = function (e) {
		document.querySelectorAll('#article_content')[0].style = 'none';
	}
	text.parentElement.append(expandBtn)





});


